package com.suitsoft.ut.entity.system;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.suitsoft.ut.entity.IdEntity;
import com.suitsoft.ut.entity.account.Authority;
import com.suitsoft.ut.entity.account.User;


/**
 * 权限有效时间
 *@author Suineg
 */
@Entity
@Table(name = "LW_TIME_AUTHORITY")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class TimeAuthority extends IdEntity{
	
	private Authority authority;
	private Date startDate;
	private Date endDate;
	private Date opdate;
	private User opuser;
	private Integer effective;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AUTH_ID")
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public Authority getAuthority() {
		return authority;
	}
	public void setAuthority(Authority authority) {
		this.authority = authority;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public Date getOpdate() {
		return opdate;
	}
	public void setOpdate(Date opdate) {
		this.opdate = opdate;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getOpuser() {
		return opuser;
	}
	public void setOpuser(User opuser) {
		this.opuser = opuser;
	}
	public Integer getEffective() {
		return effective;
	}
	public void setEffective(Integer effective) {
		this.effective = effective;
	}
}

